package com.qcby.admin.dao;

import com.qcby.admin.model.SysRole;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 角色信息表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-09-01
 */
public interface SysRoleMapper extends BaseMapper<SysRole> {

    List<String> selectRoleKeyByUserId(Long id);

    @Select("select r.* from sys_role r ,sys_user_role ur where r.id=ur.role_id and ur.user_id=#{userId}")
    List<SysRole> listUserRole(Long userId);
    @Select("select role_id from sys_user_role where user_id=#{userId}")
    List<Long> selectRoleIds(Long userId);
}
